/**
 *<p>Copyright: Copyright (c) 2012</p> 
 *<p>Company: SCPII</p>
 *<p>Project:optimus-manage</p>
 *@author xiezhouyan
 *@Date 2013-5-17 下午4:36:41
 *@version 1.0
 *@description:
 */
package com.cybertron.ironhide.manage.common.base;

import java.io.File;
import java.io.Serializable;

import org.apache.commons.lang.StringUtils;
import org.codehaus.jackson.map.annotate.JsonDeserialize;

import com.cybertron.ironhide.manage.common.json.deserializer.ImageInfoDeSerializer;

@JsonDeserialize(using = ImageInfoDeSerializer.class)
public class ImageInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2563130956101158550L;

	public static final String WIDTH = "width";

	public static final String HEIGHT = "height";

	public static final String SIZE = "size";

	public static final String COLORSPACE = "colorspace";

	private File orignFile;

	private Integer width;

	private Integer height;

	private Long size;

	private String colorspace;

	public ImageInfo(Integer width, Integer height, Long size, String colorspace) {
		super();
		this.width = width;
		this.height = height;
		this.size = size;
		this.colorspace = colorspace;
	}

	public Integer getWidth() {
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getHeight() {
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

	public Long getSize() {
		return size;
	}

	public void setSize(Long size) {
		this.size = size;
	}

	public String getColorspace() {
		return colorspace;
	}

	public void setColorspace(String colorspace) {
		this.colorspace = colorspace;
	}

	public File getOrignFile() {
		return orignFile;
	}

	public void setOrignFile(File orignFile) {
		this.orignFile = orignFile;
	}

	public boolean isRGB() {
		return StringUtils.indexOf(getColorspace(), ImageInfoDeSerializer.RGB) == -1 ? false
				: true;
	}

}
